package com.xiantm.study.thread.future;

public class Host {

    public Data request(final int count, char c) {
        System.out.println("    request ("+ count+", "+c +") begin");
        final FutureData futureData = new FutureData();
        new Thread(() -> {
            try {
                RealData realData = new RealData(count, c);
                futureData.setRealData(realData);
            }catch (Exception e){
                futureData.setException(e);
            }

        }).start();
        System.out.println("    request ("+ count+", "+c +") end");
        return futureData;
    }
}
